home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 4 / Apprentice-Release4.iso / Source Code / Libraries / C Internet Config / Examples ƒ / Example / IC Resource ƒ / Syslog Component ƒ / main.c < prev    next >
Encoding:
C/C++ Source or Header  |  1995-11-16  |  713 b   |  43 lines  |  [TEXT/SPM ]

  1.  
  2. #include <Folders.h>
  3.  
  4. #include "syslog.h"
  5.  
  6. void InitToolbox(void);
  7.  
  8. // Disable to create an application that logs restarts or shutdowns (not crashes)
  9. #if 1
  10. #define STARTUP
  11. #endif
  12.  
  13. void InitToolbox(void){
  14.     InitGraf(&qd.thePort);
  15.     InitFonts();
  16.     FlushEvents(everyEvent, 0);
  17.     InitWindows();
  18.     InitMenus();
  19.     TEInit();
  20.     InitDialogs(0L);
  21.     InitCursor();
  22.     MaxApplZone();
  23. }
  24.  
  25. void main(void){
  26.     FSSpec spec;
  27.     OSErr err;
  28.     short vref;
  29.     long dirid;
  30.     
  31.     InitToolbox();
  32.     
  33.     FindFolder(kOnSystemDisk,kSystemFolderType,kCreateFolder,&vref,&dirid);
  34.     FSMakeFSSpec(vref,dirid,"\pSystem Activity Log",&spec);
  35.     
  36.     setsyslogfile(&spec);
  37.     
  38. #ifdef STARTUP
  39.     syslog(LOG_INFO,"System Startup");
  40. #else
  41.     syslog(LOG_INFO,"System Shutdown");
  42. #endif
  43. }